"""indent_system URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/3.2/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  path('', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.urls import include, path
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.urls import path,re_path

from web.views import account, customer, policy, my_order,my_transaction
from web.views import level

urlpatterns = [
    # 普通登录路由
    path('login/', account.login,name='login'),
    #短信登录路由 （由普通登录跳转）
    path('sms/login/', account.sms_login,name='sms_login'),
    # 发送短信后台实现方法
    path('sms/send/', account.sms_send,name='sms_send'),
    # 菜单界面
    path("home/",account.homes,name='home'),


    #测试使用的路由
    # 订单界面
    path('order/list/', account.order_list,name='order_list'),
    path('order/list/add', account.order_list_add,name='order_list_add'),
    path('user/list/', account.user_list,name='user_list'),

    #显示级别列表的界面
    path('level/list/', level.level_list,name='level_list'),
    #添加级别列表的界面
    path('level/add/', level.level_add,name='level_add'),
    #编辑级别列表的界面
    path('level/edit/<int:pk>/', level.level_edit, name="level_edit"),
    #删除级别列表的界面
    path('level/delete/<int:pk>/', level.level_delete, name="level_delete"),
    #退出登录的功能
    path('logout', account.logout, name='logout'),

    #客户列表显示界面
    path("customer/list/", customer.customer_list, name='customer_list'),
    #客户列表添加功能
    path("customer/add/", customer.customer_add, name='customer_add'),
    # 编辑客户列表
    path('customer/edit/<int:pk>/', customer.customer_edit, name="customer_edit"),
    #重置密码
    path('customer/reset/<int:pk>/', customer.customer_reset, name="customer_reset"),
    #ajax删除客户列表中的一个数据
    path('customer/delete/', customer.customer_delete, name="customer_delete"),
    # 客户管理——交易记录界面 点击个人显示
    path('customer/charge/<int:pk>/', customer.customer_charge, name="customer_charge"),
    # ajax提交的交易数据地址
    path('customer/charge/<int:pk>/add', customer.customer_charge_add, name="customer_charge_add"),


    # 价格策略显示界面
    path('policy/list/', policy.policy_list, name="policy_list"),
    # 价格策略添加界面
    path("policy/add/", policy.policy_add, name='policy_add'),
    # 编辑价格策略
    path('policy/edit/<int:pk>/', policy.policy_edit, name="policy_edit"),
    # 删除价格策略中的一个数据
    path('policy/delete/', policy.policy_delete, name="policy_delete"),

    # path('policy/(\d+)', policy.policy_delete, name="policy_delete"),

    #
    # 客户界面展示：客户下单功能显示界面
    path('my/order/list/', my_order.my_order_list, name="my_order_list"),
    #客户界面展示：客户下单添加界面
    path('my/order/add/', my_order.my_order_add, name="my_order_add"),
    #客户界面展示：客户撤单界面
    path('my/order/cancel/<int:pk>/', my_order.my_order_cancel, name="my_order_cancel"),

    # 客户界面展示：本人交易记录
    path('my/transaction/list/', my_transaction.my_transaction_list, name="my_transaction_list"),
    # 管理员界面展示：所有人的交易记录总预览
    path('transaction/list/', my_transaction.transaction_list, name="transaction_list"),

]
